/*
Rilego - An easy Images 2 E-Book converter.
Copyright (C) 2011  Federico Improta (Kirys)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

package it.kirys.rilego.engine.outputbuilders;

import java.awt.image.IndexColorModel;

/**
 *
 * @author Federico Improta
 */
public class ColorPalette {
	static final byte[] GRAY_8_SHADES_VALUES = {
		(byte) 0xff, (byte) 0xd8, (byte) 0xb4, (byte) 0x90,
		(byte) 0x6c, (byte) 0x48, (byte) 0x24, (byte) 0x00
	};
	static final byte[] GRAY_16_SHADES_VALUES = {
		(byte) 0xff, (byte) 0xee, (byte) 0xdd, (byte) 0xcc,
		(byte) 0xbb, (byte) 0xaa, (byte) 0x99, (byte) 0x88,
		(byte) 0x77, (byte) 0x66, (byte) 0x55, (byte) 0x44,
		(byte) 0x33, (byte) 0x22, (byte) 0x11, (byte) 0x00
	};
	static final IndexColorModel GRAY_8_SHADES_MODEL = new IndexColorModel(8, 8, GRAY_8_SHADES_VALUES, GRAY_8_SHADES_VALUES, GRAY_8_SHADES_VALUES);
	static final IndexColorModel GRAY_16_SHADES_MODEL = new IndexColorModel(8,16, GRAY_16_SHADES_VALUES, GRAY_16_SHADES_VALUES, GRAY_16_SHADES_VALUES);

	public static final ColorPalette GRAY_8_SHADES = new ColorPalette(false, 8, GRAY_8_SHADES_MODEL);
	public static final ColorPalette GRAY_16_SHADES = new ColorPalette(false, 16, GRAY_16_SHADES_MODEL);

	int colorCount;
	boolean color;
	IndexColorModel colorModel;

	public boolean isColor() {
		return color;
	}

	public int getColorCount() {
		return colorCount;
	}

	public IndexColorModel getColorModel() {
		return colorModel;
	}

	public ColorPalette(boolean color, int colorCount, IndexColorModel colorModel) {
		this.colorCount = colorCount;
		this.color = color;
		this.colorModel = colorModel;
	}



}
